nums = [n for n in range(1, 10)]
for num in nums:
    if num > 3:
        print(f"{num}st")
    elif num == 1:
        print('1st')
    elif num == 2:
        print('2nd')
    else:
        print('3rd')